﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AirDrive.Companion
{
    class DriveMenuItem : MenuItem
    {
        private Drive _drive;

        public Drive Drive
        {
            get { return _drive; }
            set 
            { 
                _drive = value;
                if (value != null)
                    Text = !string.IsNullOrEmpty(value.Name) ? value.Name : value.Endpoint.ToString();
            }
        }

        public DriveMenuItem()
            : base(MenuMerge.Add, 0, System.Windows.Forms.Shortcut.None, null, null, null, null, null)
        {
        }

        public DriveMenuItem(string text)
            : base(MenuMerge.Add, 0, System.Windows.Forms.Shortcut.None, text, null, null, null, null)
        {
        }

        public DriveMenuItem(string text, EventHandler onClick)
            : base(MenuMerge.Add, 0, System.Windows.Forms.Shortcut.None, text, onClick, null, null, null)
        {
        }

        public DriveMenuItem(string text, MenuItem[] items)
            : base(MenuMerge.Add, 0, System.Windows.Forms.Shortcut.None, text, null, null, null, items)
        {
        }

        public DriveMenuItem(string text, EventHandler onClick, System.Windows.Forms.Shortcut shortcut)
            : base(MenuMerge.Add, 0, shortcut, text, onClick, null, null, null)
        {
        }
    }
}
